package cn.edu.wynu.d1_inner_class1;

public class Outer {
    private int age = 80;
    public static String a;
    // 成员内部类
    public class Inner{
        private String name;
        public static String schoolName; // 从jdk16开始，才可以定义静态成员变量
        private int age = 70;

        public void test(){
            System.out.println(age);
            System.out.println(a);

            int age = 60;
            System.out.println(age);// 输出60
            System.out.println(this.age);// 输出70
            System.out.println(Outer.this.age);// 输出80
        }

        public String getName(){
            return name;
        }

        public void setName(String name){
            this.name = name;
        }
    }

    public void test2(){
        System.out.println(age);
        System.out.println(a);
    }
}
